package _31define;

public class Box<T> {
    private T content;

    public Box(T content) {
        this.content = content;
    }

    public T getContent() {
        return content;
    }

    public void setContent(T content) {
        this.content = content;
    }
}
class Student{
    public void study(){
        System.out.println("学习使我快乐");
    }
}
class Teacher{
    public void teach(){
        System.out.println("教书使我快乐");
    }
}
class Test{
    public static void main(String[] args) {
        Box<Student> box1=new Box<>(new Student());
        Box<Teacher> box2=new Box<>(new Teacher());
        box1.getContent().study();
        box2.getContent().teach();
    }
}
